/**
 * FileServer.java created by zhangzhidong 
 * at 下午10:40:42 2015年9月8日
 */
package fileserver;

import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * @author Alex
 *
 */
public class FileServer extends AbstractServer {
	private Thread acceptThread;
	private Queue<ServerSocketChannel> connectedSocketChannels;
	/**
	 * @Param
	 * @Author Alex
	 */
	
	
	public String getDescription() {
		// TODO Auto-generated method stub
		return "FileServer";
	}

	/**
	 * @Param
	 * @Author Alex
	 */

	
	public void start() {
		// TODO Auto-generated method stub
		acceptThread.start();
		

	}

	/**
	 * @Param
	 * @Author Alex
	 */

	
	public void initInternal() {
		// TODO Auto-generated method stub
		connectedSocketChannels = new ConcurrentLinkedQueue<ServerSocketChannel>();
		acceptThread = new Thread(new ScanningSelectorThread(selector, connectedSocketChannels));
	}

	/**
	 * @Param
	 * @Author Alex
	 */
	
	
	public void stopInternal() {
		// TODO Auto-generated method stub
		
		
		
	}
	public static void main(String args[]) {
		Server s =	new FileServer();
		s.setPort(1000);
		s.init();
		s.start();
	}

}
